/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nexus.foros;

import control.UserBean;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import javax.faces.context.FacesContext;
import javax.faces.el.VariableResolver;

/**
 *
 * @author juampi
 */
public class ListaForo {
    private Integer nroFilas=new Integer(10);

    public ListaForo(){
        
    }
    public ArrayList<Foro> getForos(){
        ArrayList<Foro> foros=GestorForosDB.getInstance().listarForosUsuarioAdm(getUsuario().getId(),getUsuario().getCodigoCurso());
        return foros;
    }
    public Integer getNroFilas(){return nroFilas;}
    public void scrollerAction(ActionEvent event)
    {
        
    }
    public UserBean getUsuario(){
        FacesContext facesContext = FacesContext.getCurrentInstance();
        VariableResolver vr = facesContext.getApplication().getVariableResolver();
        UserBean user = (UserBean)vr.resolveVariable(facesContext, "userBean");
        return user;
    }
}
